﻿using System;
using System.Collections.Generic;

namespace ReflectAndMetadata
{
    public class TypeSample
    {
        public TypeSample()
        {
        }

        public void GetMetaData()
        {
            //运行时
            Type t1 = DateTime.Now.GetType();
            Console.WriteLine(t1);
            //编译时
            Type t2 = typeof(DateTime);
            Console.WriteLine(t2);


            Type t3 = typeof(DateTime[]); // 1-d Array type
            Console.WriteLine(t3);
            Type t4 = typeof(DateTime[,]); // 2-d Array type
            Console.WriteLine(t4);

            Type t5 = typeof(Dictionary<int, int>); // Closed generic type
            Console.WriteLine(t5);
            Type t6 = typeof(Dictionary<,>); // Unbound generic type
            Console.WriteLine(t6);
        }
    }


}
